package com.ITArmy.service;

import com.ITArmy.beans.Order;
import com.ITArmy.beans.Serialize;
import com.ITArmy.common.ServerResponse;
import com.sun.org.apache.xpath.internal.operations.Or;
import org.springframework.ui.Model;

import javax.servlet.http.HttpServletRequest;
import java.util.List;

public interface OrderService {
    /**
     *添加订单信息
     * @param order order
     * @return ServerResponse
     */
    ServerResponse addOrderByBack(Order order);

    /**
     * 遍历订单信息
     * @return ServerResponse
     */
    List<Order> orderList();

    /**
     *修改订单信息
     * @param order order
     * @return ServerResponse
     */
    ServerResponse updateOrder(Order order);

    /**
     *通过订单号查找订单信息
     * @param oid oid
     * @return ServerResponse
     */
    ServerResponse findOrderByOId(Long oid);

    /**
     * 通过用户id查找订单信息
     * @param uid uid
     * @return ServerResponse
     */
    ServerResponse findOrderByUid(Long uid);

    /**
     *通过连载id查找订单信息
     * @param sid sid
     * @return ServerResponse
     */
    ServerResponse findOrderBySid(Long sid);

    /**
     *通过订单号删除订单信息
     * @param oid oid
     * @return ServerResponse
     */
    ServerResponse deleteOrder(Long oid);

    /**
     *批量删除
     * @param ids ids
     * @return ServerResponse
     */
    ServerResponse deleteManyByIds(String[] ids);

    /**
     * 通过用户id查找购买连载id
     * @param uid uid
     * @return ServerResponse
     */
    List<Long> findSidByUid(long uid);

    /**
     * 用户进行购买产生新的订单
     * @param request request
     * @param order order
     * @return ServerResponse
     */
    ServerResponse addOrder(HttpServletRequest request,Order order);

    /**
     *用户通过支付宝支付时生成订单
     */
    ServerResponse addOrderWhenAlipay(HttpServletRequest request,Order order);
}
